home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Mode Examples / ManipCols-Example < prev    next >
Encoding:
Text File  |  2000-10-30  |  12.2 KB  |  345 lines

  1. -*-Setx-*-
  2.  
  3.  
  4. # Manipulate Columns Tutorial
  5. =============================
  6.  
  7. This is a tutorial that demonstrates the "manipCols" feature. In  order  to
  8. use it, you must first activate the feature  by  going  to  the  menu  item
  9. "Config --> Preferences --> Features" and selecting  'Manip  Cols'  in  the
  10. features list by checking the corresponding checkbox.
  11.  
  12. The 'manipCols' package is  a  feature  which  allows  one  to  do  various
  13. manipulations with the columns of any tabulated material, i.e. a series  of
  14. lines in which items are separated by a tabulation or by any other specific
  15. character (like & or a tabulation or a colon, a comma, an  endash  etc.  or
  16. even the space character). Once it is installed and activated,  it  adds  a
  17. submenu called "Columns" to the "Text" menu in Alpha.  The  items  of  this
  18. submenu are explained below. Basic manipulations  are  copying,  inserting,
  19. appending, twiddling,  deleting,  sorting,  numbering  and  (un/)equalizing
  20. columns, formating text in columns.
  21.  
  22. This Tutorial, when opened through a hyperlink, is a "shell"  window.  None
  23. of the changes you make will affect the  actual  file.  If  you  close  the
  24. window and then click on the hyperlink again, you will start with the  same
  25. example as before.  Note that "Undo" is not available in shell windows.
  26.  
  27. This tutorial is in Setx mode to take advantage of some  file  marking  and
  28. colorizing procedures. The manipCols feature can work in any mode.
  29.  
  30.  
  31. # Columns selection
  32. ===================
  33.  
  34.  
  35. To select one or several columns, put the cursor anywhere in  the  text  of
  36. the top left item (or "cell") you want to select, press  the  mouse  button
  37. and,  without releasing the button, go to the text of the bottom right item
  38. you want to select.
  39.  
  40. This will hilite a region which is much more than what  you  want  but  the
  41. package will consider only the columns located between the top  and  bottom
  42. positions.
  43.  
  44. Here is an example (from Romeo and Juliet). We suppose here that each  word
  45. is separated by a tabulation (any single  character  can  be  chosen  as  a
  46. separator, even the space character; see below) :
  47.  
  48. Gallop    apace,    you    fiery footed    steeds,
  49. Towards    Phoebus'    lodging;    such    a    waggoner
  50. As    Phaethon    would    whip    you    to    the    west,
  51. And    bring    in    cloudy    night    immediately.
  52.  
  53. Put the cursor in the word 'you' (first row, third word), press  the  mouse
  54. button and, without releasing it, go to the word 'whip' in the  third  row,
  55. then release. Now use the "Text --> Columns --> Copy  Columns"  menu  item.
  56. Now paste it here:
  57.  
  58.  
  59.  
  60.  
  61. you should have selected the following region
  62.  
  63. you    fiery footed
  64. lodging;    such
  65. would    whip
  66.  
  67. even though all the words from 'you' to 'whip' are hilited.  We  have  thus
  68. selected columns 3-4 and rows 1-3.
  69.  
  70.  
  71. # Columns Colorizing
  72. --------------------
  73.  
  74.  
  75. It is sometimes difficult to be sure what has been selected because columns
  76. are not aligned vertically so ou can check this using the menu item
  77. "Text --> Colorize Columns" : only the selected columns will be colorized.  
  78. Highlight the region again, and then use this menu item.
  79.  
  80. Gallop    apace,    you    fiery footed    steeds,
  81. Towards    Phoebus'    lodging;    such    a    waggoner
  82. As    Phaethon    would    whip    you    to    the    west,
  83. And    bring    in    cloudy    night    immediately.
  84.  
  85. So dragging the mouse from position (a,b) in a table to position (c,d) 
  86. selects columns 'a' to 'c' and rows 'b' to 'd'.
  87.  
  88.  
  89. # Equalizing Columns
  90. --------------------
  91.  
  92.  
  93. If you want to have a better vertical alignment of your columns you can use
  94. the "Equalize Columns" menu item. Select the region as above (or the entire
  95. selection) and select "Equalize Columns" in the "Text --> Columns" menu.
  96.  
  97. Gallop    apace,    you    fiery footed    steeds,
  98. Towards    Phoebus'    lodging;    such    a    waggoner
  99. As    Phaethon    would    whip    you    to    the    west,
  100. And    bring    in    cloudy    night    immediately.
  101.  
  102. The result should be :
  103.  
  104. Gallop     apace,      you         fiery footed    steeds,
  105. Towards    Phoebus'    lodging;    such            a          waggoner    
  106. As         Phaethon    would       whip            you        to              the    west,
  107. And        bring       in          cloudy          night      immediately.
  108.  
  109. By the way, equalizing makes it very easy to  use  rectangular  hiliting  :
  110. now try to select a region with the mouse holding the option key down.
  111.  
  112.  
  113. # Notes regarding column selection
  114. -------------------------------------
  115.  
  116. • the cursor can be positioned anywhere in a "cell"  :  the  entire  column
  117. will always be selected.
  118.  
  119. • you do not have necessarily to colorize the selected region. This is just
  120. handy for visualisation. BEWARE  that  this  procedure  removes  all  other
  121. colors in your document (this proc might be improved later).
  122.  
  123. • columns are numbered from 1 to n (see the messages in the status bar).
  124.  
  125. • hiliting must still be there if you want to  apply  a  manipulation  like
  126. copying, inserting, appending, twiddling, deleting columns.
  127.  
  128. • note that (since version 0.5b) you DO NOT have anymore to escape (i-e put
  129. a backslash before) the special characters like 'backslash' \ or 'dollar' $
  130. or 'circumflex' ^ or 'endash'  -  etc.  The  package  takes  care  of  this
  131. internally. The tabulation character though is represented by '\t'.
  132.  
  133. • all the actions are  undoable  (with  cmd-Z),  except  in  this  tutorial
  134. "shell" window.
  135.  
  136.  
  137. # Column Selection Key Bindings
  138. ------------------------
  139.  
  140. All of the menu items that you have just used are  also  available  through
  141. key bindings. All the key bindings will use 'ctrl-c' (c for columns !).
  142.  
  143. Hit 'ctrl-c', release, then hit one of the following letters :
  144.  
  145.     <ctrl-c c>    to <c>opy columns
  146.     <ctrl-c d>    to <d>elete columns
  147.     <ctrl-c i>    to <i>nsert columns
  148.     <ctrl-c k>    to <k>olorize <k>olumns
  149.     <ctrl-c x>    to cut columns (e<x>tract them and copy in system scrap)
  150.  
  151.  
  152. The menu item "Text --> Columns -> Columns Bindings" will  display  all  of
  153. the key bindings available.
  154.  
  155.  
  156. # Columns separator
  157. -------------------
  158.  
  159. The Columns separator must NECESSARILY be a SINGLE character. 
  160.  
  161. The default is the tabulation character <\t>. Changing the separator can be
  162. done using the "Columns Separator" menu item, which is bound to <ctrl-c s>.
  163. This separator will remain changed throughout the remainder of  your  Alpha
  164. session. The "Config --> Packages --> Manip Cols Prefs" menu item  includes
  165. a preference for the default separator.
  166.  
  167. With Latex you might want to choose '&' as a separator for \array or \table
  168. environments:
  169.  
  170.     \begin{tabular}{|c|c|c|}
  171.     \hline
  172.     you & fiery-footed \\
  173.     lodging; & such \\
  174.     would & whip \\
  175.     \hline
  176.     \end{tabular}
  177.  
  178. You can even use  the  'space'  character  as  a  separator.  
  179.  
  180.  
  181. # Text columnizing
  182. ==================
  183.  
  184.  
  185. There are tools to format text in vertical  justified  columns  (single  or
  186. multiple). This will be very handy to prepare nice looking  documentations,
  187. help files, etc. All the paragraphs in the present file have been justified
  188. with this tool. Everything  is  parametrizable:  number  of  columns,  left
  189. margin, text width.
  190.  
  191. Highlight this entire selection, and then use the  "Columnize  Text"  item.
  192. (This is also bound to <ctrl-c j>.)
  193.  
  194. Gallop    apace,    you    fiery footed    steeds,
  195. Towards    Phoebus'    lodging;    such    a    waggoner
  196. As    Phaethon    would    whip    you    to    the    west,
  197. And    bring    in    cloudy    night    immediately.
  198.  
  199.  
  200. You should end up with something like this:
  201.  
  202.  
  203. Gallop apace, you fiery footed steeds, Towards  Phoebus'  lodging;  such  a
  204. waggoner As Phaethon would whip you to the west, And bring in cloudy  night
  205. immediately. 
  206.  
  207.  
  208. Here an example of multicolumnizing :
  209.  
  210. Gallop  apace,        you    to the west, and bring in    That runaways'  eyes  may
  211. fiery-footed      steeds,    cloudy night immediately.    wink, and Romeo  leap  to
  212. towards Phoebus' lodging;    Spread thy close curtain,    these arms,  untalk'd-of,
  213. such  a    waggoner    as    love performing    night!    and unseen !
  214. Phaethon would  whip  you
  215.  
  216.  
  217. Highlight this region, select "Multi Columnize Text" (a dynamic menu  item,
  218. which appears when holding down the control key in the  Columns  menu),  and
  219. the status bar window will ask you how many columns you would like. Try it!
  220.  
  221.  
  222. Gallop apace, you fiery-footed steeds, towards Phoebus' lodging; such a
  223. waggoner as Phaethon would whip you to the west, and bring in cloudy night
  224. immediately.  Spread thy close curtain, love performing night!  That
  225. runaways' eyes may wink, and Romeo leap to these arms, untalk'd-of, and
  226. unseen !
  227.  
  228.  
  229. A "Uncolumnize Text" menu item is available by pressing the option key,  or
  230. with the key binding <ctrl-c z>. Try to uncolumnize this text:
  231.  
  232.  
  233. Gallop apace,  you    Phaethon     would    Spread  thy  close    Romeo   leap    to
  234. fiery-footed          whip  you  to  the    curtain,      love    these        arms,
  235. steeds,    towards    west, and bring in    performing  night!    untalk'd-of,   and
  236. Phoebus'  lodging;    cloudy       night    That     runaways'    unseen !
  237. such a waggoner as    immediately.          eyes may wink, and
  238.  
  239.  
  240. Use the "Text --> Fill Paragraph" menu item to then make it "normal", 
  241. using the left fill column preference of the current mode.
  242.  
  243.  
  244. # More examples
  245. ===============
  246.  
  247.  
  248. You can now select a region and experiment : here are some examples applied
  249. to our now favorite passage:
  250.  
  251. Gallop    apace,    you    fiery footed    steeds,
  252. Towards    Phoebus'    lodging;    such    a    waggoner
  253. As    Phaethon    would    whip    you    to    the    west,
  254. And    bring    in    cloudy    night    immediately.
  255.  
  256.  
  257. #    'Deleting'
  258.  
  259. Gallop     apace,      steeds, 
  260. Towards    Phoebus'    a           waggoner    
  261. As         Phaethon    you         to              the        west,       
  262. And        bring       in          cloudy          night      immediately.
  263.  
  264. #    'Copying, selecting the first two lines and appending'
  265.  
  266. Gallop     apace,      you         fiery-footed    steeds,    you             fiery-footed
  267. Towards    Phoebus'    lodging;    such            a          waggoner        lodging;        such        
  268. As         Phaethon    would       whip            you        to              the             west,       
  269. And        bring       in          cloudy          night      immediately.
  270.  
  271. #    'Copying, selecting the second column and inserting'
  272.  
  273. Gallop     you         fiery-footed    apace,      you         fiery-footed    steeds,
  274. Towards    lodging;    such            Phoebus'    lodging;    such            a          waggoner    
  275. As         would       whip            Phaethon    would       whip            you        to              the    west,
  276. And        bring       in          cloudy          night      immediately.
  277.  
  278. #    'Twiddling'
  279.  
  280. Gallop     apace,      fiery-footed    you         steeds,
  281. Towards    Phoebus'    such            lodging;    a          waggoner    
  282. As         Phaethon    whip            would       you        to              the    west,
  283. And        bring       in          cloudy          night      immediately.
  284.  
  285. #    'Sorting Columns'
  286.  
  287. Gallop     apace,      lodging;    such            steeds,
  288. Towards    Phoebus'    would       whip            a          waggoner    
  289. As         Phaethon    you         fiery-footed    you        to              the    west,
  290. And        bring       in          cloudy          night      immediately.
  291.  
  292. #    'Selecting the first two lines and reverse sorting rows'
  293.  
  294. you             steeds,     apace,          Gallop          fiery-footed
  295. waggoner        Towards     such            Phoebus'        lodging;        a           
  296. As              Phaethon    would           whip            you             to              the    west,
  297. And             bring       in              cloudy          night           immediately.
  298.  
  299. #    'Selecting all four lines and inserting rows numbers'
  300.  
  301. 1    Gallop     apace,      you         fiery-footed    steeds,
  302. 2    Towards    Phoebus'    lodging;    such            a          waggoner    
  303. 3    As         Phaethon    would       whip            you        to              the    west,
  304. 4    And        bring       in          cloudy          night      immediately.
  305.  
  306. etc. etc.
  307.  
  308.           
  309.     ----------------------------------------------------------------------
  310.  
  311.  
  312. # Key Bindings
  313. ==============
  314.  
  315. All the key bindings will use 'ctrl-c' (c for columns !). 
  316.  
  317. Hit 'ctrl-c', release, then hit one of the following letters :
  318.  
  319.     <ctrl-c a>    to <a>ppend columns
  320.     <ctrl-c b>    to show info about <b>indings
  321.     <ctrl-c c>    to <c>opy columns
  322.     <ctrl-c d>    to <d>elete columns
  323.     <ctrl-c e>    to <e>qualize columns
  324.     <ctrl-c i>    to <i>nsert columns
  325.     <ctrl-c j>    to <j>ustify text
  326.     <ctrl-c k>    to <k>olorize <k>olumns
  327.     <ctrl-c m>    to put text in <m>ulticolumns
  328.     <ctrl-c n>    to <i>nsert rows numbers
  329.     <ctrl-c o>    to sort each row in increasing <o>rder
  330.     <ctrl-c p>    to com<p>lete rows
  331.     <ctrl-c r>    to sort each row in <r>everse order
  332.     <ctrl-c s>    to change the columns <s>eparator
  333.     <ctrl-c t>    to <t>widdle columns
  334.     <ctrl-c u>    to <u>nequalize columns
  335.     <ctrl-c v>    to set the margin <v>alues for columnizing
  336.     <ctrl-c x>    to cut columns (e<x>tract them and copy in system scrap)
  337.     <ctrl-c z>    to uncolumni<z>
  338.  
  339.  
  340. The menu item "Text --> Columns -> Columns Bindings", bound to <ctrl-c  b>,
  341. will display all of the key bindings available.
  342.  
  343.  
  344. # End of Tutorial.
  345.